/*
 * ConnectEventResource.h
 *
 *  Created on: 2013. 12. 26.
 *      Author: mega
 */

#ifndef CONNECTEVENTRESOURCE_H_
#define CONNECTEVENTRESOURCE_H_

namespace ProjectZ { namespace NResource {

class ConnectEventResource
{
public:
	class ConnectEventData
	{
	public:
		struct Flyweight
		{
			int _REWARD_TYPE;
			int _ITEM_SHEETTYPE;
			int _ITEM_TID;
			int _ITEM_QUANTITY;
			int _GOLD;
			int _ZEN;
			time_t _START_DATE;
			time_t _END_DATE;
			Toolkit::Str<500> _MESSAGE;
		};

	public:
		ConnectEventData();
		virtual ~ConnectEventData();

		bool	LoadResource(int company, int salecode);
		Flyweight *	GetEvent();

	public:
		typedef std::vector<Flyweight *>		DATAVECTOR;

	private:
		void	Clear();

	private:
		DATAVECTOR	clsFlyVector;
	};


public:
	ConnectEventResource();
	virtual ~ConnectEventResource();

	bool	LoadResource();
	bool	SendConnectEventReward(User * pUser);

private:
	bool	IsRecvReward(User * pUser, ConnectEventData::Flyweight * pFly);
	ConnectEventData::Flyweight *	GetEvent(User * pUser);

private:
	ConnectEventData * pConnectEventAD;
	ConnectEventData * pConnectEventIOS;
};

} /*NResource*/ } /* namespace ProjectZ */

#endif /* CONNECTEVENTRESOURCE_H_ */
